Content starts here XML Types and Return Types
This page last changed on Feb 26, 2008.

eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents

XML Types and Return Types

In entity data services there are two types of types:

  • Return types
  • XML types

XML types and return types are very closely related. In data service operations involving entity data services, XML types define the shape of the data service.

Physically XML Types are represented a global elements in XML schemas (XSD files.) In other words, the XML types represents in hierarchical form the shape of the data service.

A way to think of these two artifacts is to first consider the class and the instance of the class in such languages as Java.

XML types can be thought of as a class from which objects in the form of functions are created. In many cases the information needed by these functions is either:

  • A subset of the overall XML types -- for example, a function that returns last name and address but not first name or social security number.
  • In need of further specification -- for example, adjusting a query to list all orders inside each customer rather than to repeat customer information each time.
    Return and XML types can be see in action in the following example:
    Creating Your First Data Services

Where XML Types are Used

ALDSP uses XML types in its model diagrams, entity data services, query editor, update mapper, and metadata browser.

Where Return Types are Used

Return types are sometimes called target schemas.  

Return types can be thought of as the backbone of both data services and data models. Programmatically, return types are the "r" in FLWR (for-let-where-return) queries.

Return types have the following main purposes:

  • Provide a template for the mapping of data from a variety of data sources and, in the case of updates, back to those data sources.
  • Help determine the arrangement of the XML document generated by the XQuery.

Return types describes the structure or shape of data that a query produces when it is run.

In order to maintain the integrity of AquaLogic Data Services Platform queries used by your application, it is important that the query return type match the XML type in the containing data service. Thus if you make changes in the return type, you should use the XQuery Editor's "Save and associate schema" command to make the data service's XML type consistent with query-level changes. Alternatively, create a new data service based on your return type. For details see Creating a Simple Data Service Function.
Document generated by Confluence on Apr 28, 2008 15:54